/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package VIEW;

import BEANS.ComboItem;
import CONTROLLERS.SecHandTradeInController;
import UTIL.InputValidator;
import datechooser.beans.DateChooserCombo;
import java.awt.event.KeyEvent;
import javax.swing.JComboBox;
import javax.swing.JTable;

/**
 *
 * @author weak_2030
 */
public class TradeToBrandNew extends javax.swing.JPanel {
    private static SecHandTradeInController tradeInController;
    /**    SecHand

     * Creates new form TradeToBrandNew
     */
    public TradeToBrandNew() {
        
        try{
        initComponents();
        tradeInController = new SecHandTradeInController(productNameInput, 
                descriptionInput,dateOfSwapInput, multipleCategoryComboBox, 
                receiptNumberInput, productsTable, tradeHistory, searchInput, 
                clearMark, fromDate, toDate, multipleProductNameInput,
                multipleDescriptionInput, tradeNewCategoryComboBox,
                multipleDateOfSwap, customerNewItemsToBrandNewTable,
                multipleProductsTable, inventorySearchInput, productsSearchClearMark);
        InputValidator.enabler(customerNewItemsToBrandNewTable, jButton5);
        InputValidator.enabler2(customerNewItemsToBrandNewTable, jButton7);
        InputValidator.enabler(customerNewItemsToBrandNewTable, jButton4);
        InputValidator.enabler(multipleProductsTable, jButton4);
        jTabbedPane1.setVisible(false);
        }catch(Exception e){
            e.printStackTrace();
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tradeInHistoryDialog = new javax.swing.JDialog();
        jLabel8 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tradeHistory = new javax.swing.JTable();
        jLabel9 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        fromDate = new datechooser.beans.DateChooserCombo();
        toDate = new datechooser.beans.DateChooserCombo();
        jLabel10 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        multipleProductNameInput = new javax.swing.JTextField();
        multipleDescriptionInput = new javax.swing.JTextField();
        multipleCategoryComboBox = new javax.swing.JComboBox();
        multipleDateOfSwap = new datechooser.beans.DateChooserCombo();
        jButton3 = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        customerNewItemsToBrandNewTable = new javax.swing.JTable();
        jLabel17 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        multipleProductsTable = new javax.swing.JTable();
        jButton4 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        productsSearchClearMark = new javax.swing.JLabel();
        inventorySearchInput = new javax.swing.JTextField();
        jSeparator1 = new javax.swing.JSeparator();
        jButton5 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        productNameInput = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        tradeNewCategoryComboBox = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        receiptNumberInput = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        descriptionInput = new javax.swing.JTextField();
        clearMark = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        dateOfSwapInput = new datechooser.beans.DateChooserCombo();
        jLabel7 = new javax.swing.JLabel();
        searchInput = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        productsTable = new javax.swing.JTable();
        jButton2 = new javax.swing.JButton();

        tradeInHistoryDialog.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        tradeInHistoryDialog.setTitle("Brand New Product Trade-in History ");
        tradeInHistoryDialog.setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel8.setText("History");

        tradeHistory.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        tradeHistory.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Date Swapped", "Customer Product", "Description", "Swapped Product"
            }
        ));
        tradeHistory.setRowHeight(20);
        jScrollPane2.setViewportView(tradeHistory);

        jLabel9.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel9.setText("From:");

        jLabel11.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel11.setText("To:");

        fromDate.setWeekStyle(datechooser.view.WeekDaysStyle.FULL);

        javax.swing.GroupLayout tradeInHistoryDialogLayout = new javax.swing.GroupLayout(tradeInHistoryDialog.getContentPane());
        tradeInHistoryDialog.getContentPane().setLayout(tradeInHistoryDialogLayout);
        tradeInHistoryDialogLayout.setHorizontalGroup(
            tradeInHistoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tradeInHistoryDialogLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(tradeInHistoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 650, Short.MAX_VALUE)
                    .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tradeInHistoryDialogLayout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(fromDate, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(12, 12, 12)
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(toDate, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(6, 6, 6)))
                .addContainerGap())
        );
        tradeInHistoryDialogLayout.setVerticalGroup(
            tradeInHistoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tradeInHistoryDialogLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel8)
                .addGap(30, 30, 30)
                .addGroup(tradeInHistoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(fromDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(toDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(20, Short.MAX_VALUE))
        );

        jLabel10.setText("jLabel10");

        setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel12.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel12.setText("Product Name:");
        jPanel2.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 14, -1, -1));

        jLabel13.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel13.setText("Description:");
        jPanel2.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 48, -1, -1));

        jLabel14.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel14.setText("Category:");
        jPanel2.add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 80, -1, -1));

        jLabel15.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel15.setText("Date of Swap:");
        jPanel2.add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 10, -1, -1));

        multipleProductNameInput.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jPanel2.add(multipleProductNameInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(113, 11, 200, -1));

        multipleDescriptionInput.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jPanel2.add(multipleDescriptionInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(113, 45, 200, -1));

        multipleCategoryComboBox.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        multipleCategoryComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jPanel2.add(multipleCategoryComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(113, 74, 200, -1));

        multipleDateOfSwap.setFormat(0);
        multipleDateOfSwap.setWeekStyle(datechooser.view.WeekDaysStyle.FULL);
        multipleDateOfSwap.setFieldFont(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 14));
        jPanel2.add(multipleDateOfSwap, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 10, 200, -1));

        jButton3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton3.setText("Add Product");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 70, -1, -1));

        jLabel16.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel16.setText("Secondhand Products to be Traded:");
        jPanel2.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 120, -1, -1));

        customerNewItemsToBrandNewTable.setAutoCreateRowSorter(true);
        customerNewItemsToBrandNewTable.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        customerNewItemsToBrandNewTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Supplier_id", "Product Name", "Description", "Category"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        customerNewItemsToBrandNewTable.setRowHeight(20);
        jScrollPane3.setViewportView(customerNewItemsToBrandNewTable);

        jPanel2.add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 146, 480, 280));

        jLabel17.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel17.setText("Inventory Product List:");
        jPanel2.add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 40, -1, -1));

        multipleProductsTable.setAutoCreateRowSorter(true);
        multipleProductsTable.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        multipleProductsTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "product_id", "Product Name", "Category", "Supplier", "Quantity"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        multipleProductsTable.setRowHeight(20);
        jScrollPane4.setViewportView(multipleProductsTable);

        jPanel2.add(jScrollPane4, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 68, 470, 360));

        jButton4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jButton4.setText("Trade/Swap Products");
        jButton4.setEnabled(false);
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 440, -1, -1));

        jButton6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton6.setText("Search");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(950, 40, -1, -1));

        productsSearchClearMark.setIcon(new javax.swing.ImageIcon(getClass().getResource("/UI ICONS/xmark.png"))); // NOI18N
        productsSearchClearMark.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                productsSearchClearMarkMouseClicked(evt);
            }
        });
        jPanel2.add(productsSearchClearMark, new org.netbeans.lib.awtextra.AbsoluteConstraints(920, 30, 30, 40));

        inventorySearchInput.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        inventorySearchInput.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                inventorySearchInputActionPerformed(evt);
            }
        });
        inventorySearchInput.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                inventorySearchInputKeyPressed(evt);
            }
        });
        jPanel2.add(inventorySearchInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(740, 40, 200, -1));

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jPanel2.add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(512, 11, 32, 448));

        jButton5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton5.setText("Remove Product");
        jButton5.setEnabled(false);
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 440, -1, -1));

        jButton7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton7.setText("Clear List");
        jButton7.setEnabled(false);
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 434, -1, -1));

        add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 45, -1, 510));

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Trade/Swap to Brand New Products");
        add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 11, 1050, -1));

        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel2.setText("Product Name:");
        jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, -1, -1));

        productNameInput.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                productNameInputActionPerformed(evt);
            }
        });
        jPanel1.add(productNameInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 30, 250, -1));

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel3.setText("Category:");
        jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 60, -1, -1));

        tradeNewCategoryComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        tradeNewCategoryComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tradeNewCategoryComboBoxActionPerformed(evt);
            }
        });
        jPanel1.add(tradeNewCategoryComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 60, 250, -1));

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel6.setText("New Receipt Number:");
        jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 160, -1, -1));

        receiptNumberInput.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                receiptNumberInputActionPerformed(evt);
            }
        });
        jPanel1.add(receiptNumberInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 160, 201, -1));

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel4.setText("Description:");
        jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 90, -1, -1));

        descriptionInput.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                descriptionInputActionPerformed(evt);
            }
        });
        jPanel1.add(descriptionInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 90, 250, -1));

        clearMark.setIcon(new javax.swing.ImageIcon(getClass().getResource("/UI ICONS/xmark.png"))); // NOI18N
        clearMark.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                clearMarkMouseClicked(evt);
            }
        });
        jPanel1.add(clearMark, new org.netbeans.lib.awtextra.AbsoluteConstraints(860, 30, 20, 20));
        clearMark.setVisible(false);

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel5.setText("Date of Swap:");
        jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 120, -1, -1));
        jPanel1.add(dateOfSwapInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 120, 250, -1));

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel7.setText("Inventory Product List:");
        jPanel1.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 30, -1, -1));

        searchInput.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        searchInput.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchInputActionPerformed(evt);
            }
        });
        jPanel1.add(searchInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(720, 30, 166, -1));

        jButton1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton1.setText("Search");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jPanel1.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(900, 30, -1, -1));

        productsTable.setAutoCreateRowSorter(true);
        productsTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ProductID", "Product Name", "Category", "Supplier", "Quantity", "Reorder Quantity", "Warranty"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        productsTable.setRowHeight(20);
        jScrollPane1.setViewportView(productsTable);
        if (productsTable.getColumnModel().getColumnCount() > 0) {
            productsTable.getColumnModel().getColumn(0).setResizable(false);
        }

        jPanel1.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 60, 570, 360));

        jButton2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jButton2.setText("Trade/Swap Products");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        jPanel1.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(800, 430, -1, 30));

        jTabbedPane1.addTab("Single Product", jPanel1);

        add(jTabbedPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 1000, 510));
    }// </editor-fold>//GEN-END:initComponents

    private void searchInputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchInputActionPerformed
        tradeInController.searchProduct();
    }//GEN-LAST:event_searchInputActionPerformed

    private void clearMarkMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_clearMarkMouseClicked
        tradeInController.clearSearch2();
    }//GEN-LAST:event_clearMarkMouseClicked

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        tradeInController.searchProductTable();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        tradeInController.swapToNewProduct();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void receiptNumberInputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_receiptNumberInputActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_receiptNumberInputActionPerformed

    private void productNameInputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productNameInputActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_productNameInputActionPerformed

    private void descriptionInputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_descriptionInputActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_descriptionInputActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        tradeInController.addToMultipleItemsTable();
        InputValidator.enabler(customerNewItemsToBrandNewTable, jButton5);
        InputValidator.enabler2(customerNewItemsToBrandNewTable, jButton7);
        InputValidator.enabler(customerNewItemsToBrandNewTable, jButton4);
        InputValidator.enabler(multipleProductsTable, jButton4);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        tradeInController.clearMultipleItemsTable();
        InputValidator.enabler(customerNewItemsToBrandNewTable, jButton5);
        InputValidator.enabler2(customerNewItemsToBrandNewTable, jButton7);
        InputValidator.enabler(customerNewItemsToBrandNewTable, jButton4);
        InputValidator.enabler(multipleProductsTable, jButton4);
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        tradeInController.removeSelectedCustomerItem();
        InputValidator.enabler(customerNewItemsToBrandNewTable, jButton5);
        InputValidator.enabler2(customerNewItemsToBrandNewTable, jButton7);
        InputValidator.enabler(customerNewItemsToBrandNewTable, jButton4);
        InputValidator.enabler(multipleProductsTable, jButton4);
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        tradeInController.swapMultipleToNewProduct();
        InputValidator.enabler(customerNewItemsToBrandNewTable, jButton5);
        InputValidator.enabler2(customerNewItemsToBrandNewTable, jButton7);
        InputValidator.enabler(customerNewItemsToBrandNewTable, jButton4);
        InputValidator.enabler(multipleProductsTable, jButton4);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void productsSearchClearMarkMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_productsSearchClearMarkMouseClicked
        tradeInController.clearSearch6();
    }//GEN-LAST:event_productsSearchClearMarkMouseClicked

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        tradeInController.searchProductsTable();
    }//GEN-LAST:event_jButton6ActionPerformed

    private void inventorySearchInputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inventorySearchInputActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_inventorySearchInputActionPerformed

    private void inventorySearchInputKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inventorySearchInputKeyPressed
        if (evt.getKeyCode()== KeyEvent.VK_ENTER)
	{
            jButton6.doClick();
	}   
    }//GEN-LAST:event_inventorySearchInputKeyPressed

    private void tradeNewCategoryComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tradeNewCategoryComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tradeNewCategoryComboBoxActionPerformed
    public static JTable getProductsTable(){
        return productsTable;
    }

    public static void updateSecondhandSwapToNewHistory(){
        tradeInController.updateSecondhandSwapToNewHistory();
    }
   
    public static JTable getMultipleProductsTable(){
        return multipleProductsTable;
    }

    public static JComboBox getCategoryComboBox(){
        return tradeNewCategoryComboBox;
    }
    
    public static JComboBox getMultipleCategoryComboBox(){
        return multipleCategoryComboBox;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel clearMark;
    private javax.swing.JTable customerNewItemsToBrandNewTable;
    private datechooser.beans.DateChooserCombo dateOfSwapInput;
    private javax.swing.JTextField descriptionInput;
    private datechooser.beans.DateChooserCombo fromDate;
    private javax.swing.JTextField inventorySearchInput;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private static javax.swing.JComboBox multipleCategoryComboBox;
    private datechooser.beans.DateChooserCombo multipleDateOfSwap;
    private javax.swing.JTextField multipleDescriptionInput;
    private javax.swing.JTextField multipleProductNameInput;
    private static javax.swing.JTable multipleProductsTable;
    private javax.swing.JTextField productNameInput;
    private javax.swing.JLabel productsSearchClearMark;
    private static javax.swing.JTable productsTable;
    private javax.swing.JTextField receiptNumberInput;
    private javax.swing.JTextField searchInput;
    private datechooser.beans.DateChooserCombo toDate;
    private javax.swing.JTable tradeHistory;
    private javax.swing.JDialog tradeInHistoryDialog;
    private static javax.swing.JComboBox tradeNewCategoryComboBox;
    // End of variables declaration//GEN-END:variables
}
